﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DTO;
using BUS;
using System.Collections.Generic;

public partial class tintuc : System.Web.UI.Page
{
    NewsBUS newsBUS = new NewsBUS();
    ConstBUS constBUS = new ConstBUS();
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            
                Int32 numberOnePage = constBUS.GetNewsNumberInOnePage();
                RadListViewNews.PageSize = numberOnePage;
                List<NewsDTO> news = new List<NewsDTO>();
                if(Request.QueryString.Get("sPID")!=null)
                {
                    int sPID = Int32.Parse(Request.QueryString.Get("sPID"));
                    news = newsBUS.GetActiveSubNews(sPID);
                }
                else if (Request.QueryString.Get("mPID") != null)
                {
                    int mPID = Int32.Parse(Request.QueryString.Get("mPID"));
                    news = newsBUS.GetActiveNews(mPID);
                }
                else if (Request.QueryString.Get("tID") != null)
                {
                    int tID = Int32.Parse(Request.QueryString.Get("tID"));
                    news = newsBUS.GetActiveNewsWithType(tID);
                }
                RadListViewNews.DataSource = news;
            
        }
        catch (Exception)
        { return; }
            }
}
